package flc.ast.adapter;

import android.view.View;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.FileUtils;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.SettingBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class SettingAdapter extends StkProviderMultiAdapter<SettingBean> {

    public SettingAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(82));
        addItemProvider(new SettingProvider());
    }

    private class SettingProvider extends BaseItemProvider<SettingBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_setting;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, SettingBean bean) {
            baseViewHolder.setText(R.id.tvSettingItemName, bean.getSettingName());
            if (bean.isSelected()) {
                baseViewHolder.setImageResource(R.id.ivSettingItemSel, R.drawable.xz1);
            } else {
                baseViewHolder.setImageResource(R.id.ivSettingItemSel, R.drawable.wxz1);
            }
        }
    }


}
